﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VersionComparer.Configuration;

namespace VersionComparer.UI
{
    public partial class SettingsControl : UserControl, IContainedControl
    {
        public SettingsControl()
        {
            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            propertyGrid1.SelectedObject = Settings;
        }
        public SettingsBase Settings
        {
            get;
            set;
        }

        string IContainedControl.Text
        {
            get {

                return Settings.Name;
            }
        }

        public void Close(bool save)
        {
            if (save)
                Settings.Save();
            else
                Settings.Reload();
        }
    }
}
